<?php
namespace User\Model;

use Think\Model;

class MemberModel extends Model
{
    CONST STATUS_ACTIVE = 1;//正常、已发布--
    CONST STATUS_PENDING = 2;//待审核--
    CONST STATUS_DELETE = 9;//已删除--

    public static function get_status($status = 'all')
    {
        $label = [
            self::STATUS_ACTIVE => "正常",
            self::STATUS_PENDING => "待审核",
            self::STATUS_DELETE => "已删除",
        ];
        if ($status === 'all') {
            return $label;
        }
        if (array_key_exists($status, $label)) {
            return $label[$status];
        }
        return "未知";
    }


    CONST CHANNEL_SYS = 1;//--系统路径--
    CONST CHANNEL_WX = 2;//--微信路径--

    public static function get_channel($channel = 'all')
    {
        $label = [
            self::CHANNEL_SYS => "系统路径",
            self::CHANNEL_WX => '微信注册'
        ];
        if ($channel === 'all') {
            return $label;
        }
        if (array_key_exists($channel, $label)) {
            return $label[$channel];
        }
        return "未知";
    }

}

?>